# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContainerAnalysis.V1alpha1.Model.Artifact do
  @moduledoc """
  Artifact describes a build product.

  ## Attributes

  *   `checksum` (*type:* `String.t`, *default:* `nil`) - Hash or checksum value of a binary, or Docker Registry 2.0 digest of a container.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Artifact ID, if any; for container images, this will be a URL by digest like gcr.io/projectID/imagename@sha256:123456
  *   `name` (*type:* `String.t`, *default:* `nil`) - Name of the artifact. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to `docker push`. This field is deprecated in favor of the plural `names` field; it continues to exist here to allow existing BuildProvenance serialized to json in google.devtools.containeranalysis.v1alpha1.BuildDetails.provenance_bytes to deserialize back into proto.
  *   `names` (*type:* `list(String.t)`, *default:* `nil`) - Related artifact names. This may be the path to a binary or jar file, or in the case of a container build, the name used to push the container image to Google Container Registry, as presented to `docker push`. Note that a single Artifact ID can have multiple names, for example if two tags are applied to one image.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :checksum => String.t() | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :names => list(String.t()) | nil
        }

  field(:checksum)
  field(:id)
  field(:name)
  field(:names, type: :list)
end

defimpl Poison.Decoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.Artifact do
  def decode(value, options) do
    GoogleApi.ContainerAnalysis.V1alpha1.Model.Artifact.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.ContainerAnalysis.V1alpha1.Model.Artifact do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
